package com.zy.project.system.online.repository.impl;

import com.zy.core.util.Finder;
import com.zy.project.system.online.entity.UserOnline;
import com.zy.project.system.online.repository.UserOnlineRepository;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

/**
 * Package: com.zy.project.system.online.repository.impl
 * <p>
 * Description： TODO
 * <p>
 * Author: zhangyu
 * <p>
 * Date: Created in 2018-11-4 13:38
 * <p>
 * Company: mingtu
 * <p>
 * Copyright: Copyright (c) 2018
 * <p>
 * Version: 0.0.1
 * <p>
 * Modified By:
 */
public class UserOnlineRepositoryImpl {

    @Autowired
    private UserOnlineRepository userOnlineRepository;


    public List<UserOnline> findByExpired(Date date){
        Finder finder = Finder.create(" form UserOnline as bean where bean.lastAccessTime <= :date ");
        finder.setParam("date",date);
        return userOnlineRepository.findListByFinder(finder);
    }

}
